home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Music / A / Async Family 1.14.sit / Async Family 1.14 / For programmers only / Tech notes / Tech notes
Encoding:
Text File  |  1992-06-13  |  3.2 KB  |  62 lines  |  [TEXT/ttxt]

  1. Alessandro Levi Montalcini
  2. C.so Re Umberto 10
  3. 10121 Torino
  4. Italy
  5.  
  6. Mr.Player 1.14 - Programmer's notes
  7. June 1992
  8.  
  9.  
  10. •••  NOTE: Mr.Player and the Async Family are SHAREWARE.
  11. •••  Please read the documentation for more details.
  12.  
  13.  
  14. •  TECHNICAL INTRODUCTION
  15. ◊  Mr.Player is an Apple-Event driven background-only application (file type 'appe') which is loaded at startup after the extensions and control panels. It is not an INIT, and it doesn't patch any traps. Being an application it has its own heap zone to work with, so it shouldn't mess up with the system heap (even though many Sound Manager routines allocate system heap memory). Mr.Player takes a memory partition of 40K, which is enough for its own code and for all the Sound Manager data structures it allocates - but not enough for the actual sound data, which is always loaded in temporary memory. Since the Mac isn't always playing sounds, sound memory is only allocated upon request.
  16. ◊  The Mr.Player application itself has no user interface; it is driven through System 7's Apple Events, which can be easily implemented in any application. You may also send Apple Events directly with many utilities such as CE's QuicKeys™2. If you want Mr.Player to play asynchronous multi-channel sounds for you, you can do it with a few lines of code. Please note that you'll need my written permission to redistribute Mr.Player with your own programs, event if they are free or shareware.
  17.  
  18.  
  19. •  SUPPORTED EVENTS (view this list in Monaco 9)
  20.  
  21.  [1] Event class
  22.  [2] Event ID
  23.  [3] Parameter type
  24.  [4] Parameter ID
  25.  
  26. ==---====--====--====--====---==================================--==
  27. ##   [1]   [2]   [3]   [4]    Action
  28. ==---====--====--====--====---==================================--==
  29. 01.  aevt  oapp               none
  30. 02.  aevt  odoc  ----  list   play 'AIFF' or 'sfil' sound file
  31. 03.  aevt  pdoc  ----  list   none
  32. 04.  aevt  quit               quit
  33. ==---====--====--====--====---==================================--==
  34. 05.  ßaππ  Beep               play system beep
  35. 06.  ßaππ  Play  shor  SdID   play sound resource with ID = …
  36. 07.  ßaππ  Play  shor  SdIX   play sound resource with index = …
  37. 08.  ßaππ  Stop               stop playing sounds
  38. 09.  ßaππ  StBp               stop and play system beep
  39. 10.  ßaππ  StPl  shor  SdID   stop and play res ID = …
  40. 11.  ßaππ  StPl  shor  SdIX   stop and play res index = …
  41. 12.  ßaππ  SVol  shor  SVol   set sound volume to … (0-7)
  42. 13.  ßaππ  Slep  shor  Slep   set WaitNextEvent sleep time to …
  43. ==---====--====--====--====---==================================--==
  44.  
  45.  
  46. •  ABOUT MR.PLAYER'S GESTALT
  47. ◊  Mr.Player installs a Gestalt selector of type 'ßaππ'; the selector returns a pointer to a data structure whose first item is Mr.Player's process serial number. Call Gestalt to know whether Mr.Player is currently installed (Gestalt will return an error if Mr.Player has quit) and to get its process serial number:
  48.  
  49. OSErr GetMrPlayerPSN (ProcessSerialNumber *psn)
  50. {
  51.    ProcessSerialNumber *result;
  52.    OSErr error;
  53.    
  54.    error = Gestalt ('ßaππ', (long*)&result);
  55.    if(error) return (error);
  56.    
  57.    *psn = *result;
  58.    return (noErr);
  59. }
  60.  
  61. ◊  If this routine returns an error, Mr.Player is not running. If it doesn't, you may use the process serial number to send your events to Mr.Player.
  62.